Welcome to your PHP Practice Test 3. This test can be taken unlimited times. Signed in users can have their scores saved to be viewed later. Questions will be randomly displaying each test. Good luck! 1. Which method is being called immediately after a new object is created from the class? __constructor() __construct() _constructor() _construct()2. Which of the following(s) will raise a fatal error, if the file doesn’t exist? include() include_once() require() require_once()3. Which of the following function(s) is used to exit from the script? die() end() exit() terminate()4. How many maximum numbers of characters a GET request can handle? 1048 2048 3048 40485. What will be the output for the following PHP code? $str ="Tutorials Panel is the best source to learn programming"; $arr = explode(" ",$str); echo $arr[4]; best source the is6. What is a variable in PHP? It is a variable that holds the name of another variable as value It is a pointer like we have in C++ There is nothing like that in PHP It is a reserved keyword 7. In PHP, an array can hold another array as a value. True False8. Which type of error(s) doesn’t interrupt the execution of the script in PHP? Notices Warnings Fatal errors Messages9. Which of the following is an invalid variable name? $letter $_sum $4digits $life410. Null is a special data type that holds Nothing Null Boolean Zero11. What is the output of the following code? <?php function foo($x) { $x=$x+4; } $num=7; foo($num); echo $num; ?> 11 7 3 412. Which of the following function is used to delete a file? unset() unlink() undefined() delete()13. Echo doesn’t return any value after displaying the output in PHP. True False14. How you can create a connection with MySQL server using PHP API? myqli_connect() mysql_connect() new mysqli() mysqlp_connect() 15. Which of the following function is used to create a constant variable in PHP? const() constant() define() reserved()16. How you can increase the time a program can take for the execution? Set the max_execution_time Set the max_execution Call the max_exectuton() Write a smaller program17. You can’t extend a Final defined class in PHP. True False18. Which of the following can get the IP address of the client? $_SERVER["CLIENT_IP"] $_SERVER["CLIENT_ADDR"] $_SERVER["REMOTE_ADDR"] $_SERVER["REMOTE_IP"]19. What will be the output of the following code? <?php echo gettype(10.0); ?> number integer float double20. Resources is a data type of variable that holds a reference to the internal resources. True FalsePlease fill in the comment box below.
Comments